package pers.chao.cacheable.infrastructure.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Description: 缓存redis配置
 *
 * @author W.Chao
 * @date 2020/12/2 23:47
 **/
@ConfigurationProperties(prefix = "cacheable.redis")
public class RedisCacheProperties {
	/**
	 * 第n个redis
	 */
	private int database = 0;
	/**
	 * redis ip
	 */
	private String host;
	/**
	 * redis密码，无则不填
	 */
	private String password = "";
	/**
	 * redis端口号
	 */
	private int port = 6379;
	/**
	 * 请求超时时间
	 */
	private long timeout = 5000;
	/**
	 * redis连接池最大空闲线程
	 */
	private int poolMaxIdle = 8;
	/**
	 * redis连接池最大活动线程
	 */
	private int poolMaxActive = 8;
	/**
	 * redis连接池最大阻塞等待时间
	 */
	private long poolMaxWait = 1L;
	/**
	 * redis连接池最小空闲线程
	 */
	private int poolMinIdle = 0;

	public int getDatabase() {
		return database;
	}

	public String getHost() {
		return host;
	}

	public String getPassword() {
		return password;
	}

	public int getPort() {
		return port;
	}

	public long getTimeout() {
		return timeout;
	}

	public int getPoolMaxIdle() {
		return poolMaxIdle;
	}

	public int getPoolMaxActive() {
		return poolMaxActive;
	}

	public long getPoolMaxWait() {
		return poolMaxWait;
	}

	public int getPoolMinIdle() {
		return poolMinIdle;
	}

	public void setDatabase(int database) {
		this.database = database;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public void setTimeout(long timeout) {
		this.timeout = timeout;
	}

	public void setPoolMaxIdle(int poolMaxIdle) {
		this.poolMaxIdle = poolMaxIdle;
	}

	public void setPoolMaxActive(int poolMaxActive) {
		this.poolMaxActive = poolMaxActive;
	}

	public void setPoolMaxWait(long poolMaxWait) {
		this.poolMaxWait = poolMaxWait;
	}

	public void setPoolMinIdle(int poolMinIdle) {
		this.poolMinIdle = poolMinIdle;
	}
}
